<template>
  <div class="hot">
    <div class="hot-top">
      <div>
        <h1>热门</h1>
        <h2>根据销量、搜索、好评等综合得出</h2>
        <h3 @click="moreShop">更多></h3>
      </div>
    </div>
    <div class="hot-bottom">
      <ul>
        <router-link
          tag="li"
          :to="{ path: '/detail', query: { id: likeInfos.id } }"
          v-for="likeInfos in likeInfo"
          :key="likeInfos.id"
          :likeInfos="likeInfos"
        >
          <img :src="likeInfos.image" />
          <p>{{ likeInfos.store_name }}</p>
          <span>￥{{ likeInfos.ot_price }}</span>
        </router-link>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    likeInfo: Array, //热门榜单
  },
  methods: {
    // 点击更多，跳转
    moreShop(){
      this.$router.push({
        path:'/moreShop/2',
      })
    }
  },
};
</script>

<style lang="less" scoped>
.hot {
  position: relative;
  margin-bottom: 3rem;
}
.hot-top {
  top: 0px;
  height: 3rem;
  background: no-repeat url(http://47.115.51.185/h5/img/index-bg.7128c2eb.png);
  background-size: 100% 100%;
  div {
    margin: 0.5rem 0;
    color: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 1.5rem;
    h1 {
      font-size: 0.7rem;
      font-weight: 600;
    }
    h2 {
      font-size: 0.25rem;
    }
    h3 {
      font-size: 0.25rem;
      font-family: serif;
    }
  }
}
.hot-bottom {
  position: absolute;
  bottom: -80%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: white;
  ul {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding-bottom: 5px;
    li {
      display: flex;
      flex-direction: column;
      align-items: center;
      img {
        width: 75px;
        height: 75px;
        padding-bottom: 5px;
      }
      p {
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        word-break: normal;
        width: 3rem;
      }
      span {
        font-size: 15px;
        color: red;
        
      }
    }
    :nth-child(2) {
      img {
        width: 3rem;
        height: 3rem;
      }
    }
  }
}
</style>